<template>
    <div>
      <order-bar></order-bar>
      <order-table :orderInfo='orderInfo'></order-table>
    </div>
</template>

<script>

import {getDateNums} from "./utils"
import {getOrderInfo} from '@/network/user'


import orderBar from './orderItem/orderBar.vue'
import orderTable from './orderItem/orderTable.vue'
export default {
  name:'',
  data() {
        return {
            isSign: false,
            signSrc: '',
            clientHeight: '',
            uid: null,

            // -----------
            orderInfo:[]
        }
    },
    components:{
      orderBar,
      orderTable
    },
    created() {
      this.order_nums()
      this.getOrderInfo()

    },
    methods: {
      
      order_nums() {
        var that = this;
        var outTradeNo = ""; //订单号
        for (var i = 0; i < 6; i++) //6位随机数，用以加在时间戳后面。
          {
            outTradeNo += Math.floor(Math.random() * 10);
          }                          
          outTradeNo = String(getDateNums(new Date())) + String(outTradeNo) 
          that.outTradeNo = outTradeNo;   
          console.log('outTradeNo',outTradeNo);                       
      },
      async getOrderInfo(){
        let res = await getOrderInfo()
        console.log('**************获取订单信息***************');
        console.log('@',res.data.data);
        let result = res.data.data
        if(result.status === 200){
          this.orderInfo = result.result
        }
      }
     

    }


}
</script>

<style>

</style>